home *** CD-ROM | disk | FTP | other *** search
Wrap
property whichevent, Addressee, EventToSend, DownCM, UpCM, DownNum, UpNum, button_active on beginSprite me set the UpCM of me to the member of sprite the spriteNum of me set the UpNum of me to the number of member UpCM set the DownNum of me to the number of member DownCM set the button_active of me to 0 puppetSprite(the spriteNum of me, 1) end on endSprite me puppetSprite(the spriteNum of me, 0) end on triggerSendSprite me trigger(me) end on mouseUp me set the member of sprite the spriteNum of me to UpNum set the button_active of me to 0 if whichevent = #mouseUp then trigger(me) end if end on mouseDown me set the member of sprite the spriteNum of me to DownNum set the button_active of me to 1 if whichevent = #mouseDown then trigger(me) end if end on mouseUpOutSide me set the button_active of me to 0 end on mouseLeave me if the button_active of me then set the member of sprite the spriteNum of me to UpNum end if end on mouseEnter me if the button_active of me then set the member of sprite the spriteNum of me to DownNum end if end on prepareFrame me if whichevent = #prepareFrame then trigger(me) end if end on enterFrame me if whichevent = #enterFrame then trigger(me) end if end on exitFrame me if whichevent = #exitFrame then trigger(me) end if end on trigger me sendSprite(the Addressee of me, the EventToSend of me) end on getPropertyDescriptionList set description to [:] if the currentSpriteNum = 0 then set memdefault to 0 else set memref to the member of sprite the currentSpriteNum set castLibNum to the castLibNum of memref set memdefault to member (the memberNum of member memref + 1) of castLib castLibNum end if addProp(description, #DownCM, [#default: memdefault, #format: #bitmap, #comment: "Pict for Down:"]) addProp(description, #EventToSend, [#comment: "Message:", #format: #symbol, #default: #CycleState]) addProp(description, #Addressee, [#comment: "Target Sprite:", #format: #integer, #default: the currentSpriteNum + 1]) addProp(description, #whichevent, [#comment: "Triggering Event:", #format: #symbol, #range: [#mouseUp, #mouseDown, #prepareFrame, #enterFrame, #exitFrame], #default: #mouseUp]) return description end on getBehaviorDescription return "Send a Message to the designated Sprite when the specified Event occurs. At its destination the message will be interpreted as a sprite event and any actions defined for that event will be invoked." & RETURN & "PARAMETERS:" & RETURN & "ΓÇó Message - name of event to invoke at target sprite." & RETURN & "ΓÇó Target Sprite - number of sprite channel to which message should be sent." & RETURN & "ΓÇó Triggering Event - event that should cause message to be sent." & RETURN & "NOTES:" & RETURN & "If the target sprite does not handle the message it will propagate to the cast member script, the current frame script, and then the movie, in search of a handler for that event." end on getAssocMembers set myPropList to [DownCM] return myPropList end